const db = require('../db/index')
exports.getCourseList = (req, res) => {
    // 查询所有课程信息，且 course_approval_status 字段为 'pass'
    db.query('SELECT * FROM course WHERE course_approval_status = ?', ['pass'], (error, results) => {
        if (error) {
            console.error('获取课程列表失败：', error);
            return res.status(500).json({
                success: false,
                message: '获取课程列表失败',
            });
        }
        // console.log(results);
        res.json({
            success: true,
            data: results,
        });
    });
};
